
#ifndef _Flag_H_
#define _Flag_H_

#include "WorldObject.h"
#include "Utils/Vector2D.h"
#include "Ship.h"

class Flag : public WorldObject {
  public:
    Flag(unsigned team_id, Vector2D home_position);
    ~Flag();

    void render(void);
    void renderMinimap(void);

    void update(void);
    bool active(void);

    bool resolveCollision(Ship *ship);
    bool resolveCollision(Weapon *weapon);
    bool resolveCollision(Map *map);

    WorldObjectType getObjectType(void) const { return FLAG_WOBJECT; }

    void reset(void); 
    void drop(void);

    Vector2D getPosition(void);
    Vector2D getHomePosition(void);

    Ship* getHoldingShip(void);

  private:
    unsigned team_id; // Which team does the flag belong to
    unsigned texture_id;

    Vector2D position;
    Vector2D home_position;

    Ship *holding_ship; // is NULL if nobody is holding the flag
    float size, held_size; 
    

};

#endif

